package super_usage;

/**
 * Description: 子类
 *
 * @author code-worker
 * @date 2021/10/17 9:37
 */
public class Subclass extends Base {
    private Integer height;

    public Subclass(Integer height) {
        this.height = height;
    }

    public Subclass() {
        System.out.println("Subclass");
    }

    public Subclass(Integer length, Integer width, Integer height) {
        super(length, width);
        this.height = height;
    }

    public Integer getHeight() {
        return height;
    }

    public void setHeight(Integer height) {
        this.height = height;
    }

    @Override
    public void show(){
        super.show();
        System.out.println("height = " + height);
    }

    @Override
    public void print(){
        System.out.println("Subclass");
    }

    @Override
    public String toString() {
        return "Subclass{" +
                "height=" + height +
                ", length=" + super.getLength() +
                ", width=" + super.getWidth() +
                '}';
    }
}
